import 'dart:ui';

import 'package:flutter/material.dart';
import 'package:fluttertoast/fluttertoast.dart';

class GaussianBlurPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return _GaussianBlurPageState();
  }
}

class _GaussianBlurPageState extends State<GaussianBlurPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("高斯模糊"),
        centerTitle: true,
      ),
      body: Center(
        child: Stack(
          children: <Widget>[
            GestureDetector(
              child: Image.network(
                "http://qiniu.nightfarmer.top/恶龙咆哮.gif",
                width: 300,
                height: 300,
              ),
              onTap: (){
                Fluttertoast.showToast(msg: "图片被点击了");
              },
            ),
            IgnorePointer(
              ignoring: true,
              child: BackdropFilter(
                filter: ImageFilter.blur(sigmaX: 3, sigmaY: 3),
                child: Container(
                  color: Colors.white.withOpacity(0.1),
                  width: 300,
                  height: 300,
                ),
              ),
            )
          ],
        ),
      ),
    );
  }
}
